/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package delta.productcatalog.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Kate
 */
@Entity
@Table(name = "PRODUCT")
@NamedQueries({
    @NamedQuery(name = "Product.findAll", query = "SELECT p FROM Product p"),
    @NamedQuery(name = "Product.findByName", query = "SELECT p FROM Product p WHERE p.name = :name"),
    @NamedQuery(name = "Product.findByPrice", query = "SELECT p FROM Product p WHERE p.price = :price"),
    @NamedQuery(name = "Product.findByIdProduct", query = "SELECT p FROM Product p WHERE p.idProduct = :idProduct"),
    @NamedQuery(name = "Product.findByDescription", query = "SELECT p FROM Product p WHERE p.description = :description"),
    @NamedQuery(name = "Product.findByPicture", query = "SELECT p FROM Product p WHERE p.picture = :picture"),
    @NamedQuery(name = "Product.findByRate", query = "SELECT p FROM Product p WHERE p.rate = :rate"),
    @NamedQuery(name = "Product.findByStatus", query = "SELECT p FROM Product p WHERE p.status = :status")})




public class Product implements Serializable {
@Id
    @GeneratedValue(generator="Seq_product")
    @SequenceGenerator(name="Seq_product", sequenceName="Seq_product_id_product", allocationSize=1)
    @Column(name = "id_product")
    int id_product;
    
    @Column(name = "price")
    @NotNull        
    long price;
    
    @Column(name = "name")
    @NotNull        
    String name;
    
    @Column(name = "id_category")
    int id_category;
    
    @Column(name = "description")
    String description;
    
    @Column(name = "picture")
    String picture;
    
    @Column(name="rate")
    @NotNull        
    int rate;
    
    @Column(name = "status")
    @NotNull        
    int status;


    
    
    public Product() {
    }
    
    public Product(String name,long price, int id_category,String description, int rate, int status){
       this.name=name;
       this.price=price;
       this.id_category=id_category;
       this.description=description;
       this.rate = rate;
       this.status = status;
    }

    public int getId_product() {
        return id_product;
    }

    public long getPrice() {
        return price;
    }

    public void setPrice(long price) {
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId_category() {
        return id_category;
    }

    public void setId_category(int id_category) {
        this.id_category = id_category;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }
        public int getRate() {
        return rate;
    }

    public void setRate(int rate) {
        this.rate = rate;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }
    
}
